#ifndef __MY_TRIE_H__
#define __MY_TRIE_H__

#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>

#define sys_err(args ...)	{ fprintf(stderr, args); }
#define sys_says(args ...)	{ fprintf(stdout, args); }

#define BUF_LEN	20
#define EN_LEN	26

struct my_trie {
	int flag;	//是否有下标被存储
	int *num;	//存储词组下标
	int cnt;	//下标的个数
	char ch;
	struct my_trie *next[EN_LEN];
};

struct my_trie *root;

struct my_trie *trie_create_node(char ch);
int char_to_index(char ch);
void trie_init();
void trie_insert(const char *keys, int num);
int *trie_find(const char *keys, int *num);
void trie_destroy();

#endif
